<template>
  <div class="app">
    <AppHeader/>
    <div class="app-body">
      <Sidebar :navItems="menuList"/>
      <main class="main">
        <breadcrumb :list="list"/>
        <div id="container-fluid" class="container-fluid">
          <router-view></router-view>
        </div>
      </main>
      <AppAside/>
    </div>
    <AppFooter/>
  </div>
</template>

<script>
import nav from '../_nav'
// import Cookies from 'js-cookie'
import { Header as AppHeader, Sidebar, Aside as AppAside, Footer as AppFooter, Breadcrumb } from '../components/'
// import {
//   getResourceByUserId
// } from '../api/yun/user/index'
export default {
  name: 'full',
  components: {
    AppHeader,
    Sidebar,
    AppAside,
    AppFooter,
    Breadcrumb
  },
  data () {
    return {
      nav: nav.items,
      nav2: [],
      item: {},
      children: [],
      userId: this.$store.getters.userId,
      listR: {
        roleList: null,
        menuList: []
      }
    }
  },
  computed: {
    name () {
      return this.$route.name
    },
    menuList () {
      return this.$store.getters.menuList
    },
    list () {
      // store.commit('SET_ROUTERS', this.$route.matched)
      // console.log('this.$route.matched:' + 'this.$route.matched')
      // this.$store.commit('SET_ROUTERS', this.$route.matched)
      return this.$route.matched
    }
  },
  mounted: function () {
    // getResourceByUserId({id: this.userId}).then(response => {
    //   // this.listR.menuList = response.data.menuList
    //   this.$store.commit('SET_RESOURCES', response.data.resourceList)
    // })
    // this.listR.menuList = JSON.parse(Cookies.get('menu_list'))
  }
}
</script>
<style>
  #container-fluid{
    padding-right:8px;
    padding-left:8px;
  }
</style>
